package com.ziyueyuwen.xiniao.util;

import com.ziyueyuwen.xiniao.base.SpringFactory;
import com.ziyueyuwen.xiniao.base.SysConfigData;

import static com.suyeer.fastwechat.util.FwConstUtil.FW_APP_ID;

/**
 * @author jun 2018/12/4
 */
public class ConstUtil {

    /**
     * global
     */
    public final static String DEFAULT_ENCODE = "UTF-8";
    public final static String REDIRECT = "redirect:";
    public final static String AUDIO_FILE_PATH = "/data/audio/";
    public final static String VIDEO_FILE_PATH = "/data/video/";
    public final static SysConfigData SYS_CONFIG_DATA = SpringFactory.getBean("sysConfigData");
    public final static int FILE_MAX_SIZE_ALLOWED = 80;
    public final static long FILE_SIZE_1_M = 1024 * 1024;
    public final static int DEFAULT_CACHE_SECOND = 86400;
    public final static String SUCCESS_JSON_STR = "{\"error_info\": {\"errno\": 1,\"error\": \"程序正常执行\"}}";
    public final static String CODE_INTO_CLASS = "67371107";
    public final static String CODE_OUT_CLASS = "67371111";
    public final static String CODE_END = "END";
    public final static String TANG_LANG_COURSE_NAME = "体验课";
    public final static String FILE_MP4_END_NAME = ".mp4";

    /**
     * cache key
     */
    public final static Integer DATABASE_FOR_UPDATE_USER = 3;
    public final static String MC_KEY_AUTH_INFO_INIT_TIME = "MC_KEY_AUTH_INFO_INIT_TIME";
    public final static String KEY_UPDATE_USER_INFO = "KEY_UPDATE_USER_INFO_";

    /**
     * wx
     */
    public final static String WX_URL_SILENT_AUTH = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + FW_APP_ID + "&redirect_uri=" + SYS_CONFIG_DATA.getRedirectUri() + "&scope=snsapi_base&state=silent_auth&response_type=code#wechat_redirect";
    public final static String WX_URL_HIGH_AUTH = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + FW_APP_ID + "&redirect_uri=" + SYS_CONFIG_DATA.getRedirectUri() + "&scope=snsapi_userinfo&state=high_auth&response_type=code#wechat_redirect";
    public final static String WX_GET_MEDIA_FILE = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=%s&media_id=%s";
    public final static String WX_GET_SPEEX_MEDIA_FILE = "https://api.weixin.qq.com/cgi-bin/media/get/jssdk?access_token=%s&media_id=%s";
    public final static String WX_SILENT_AUTH = "silent_auth";
    public final static String WX_RESPONSE_STATUS_SUCCESS = "SUCCESS";
    public final static String WX_PARAM_ACCESS_TOKEN = "access_token";
    public final static String WX_PARAM_OPENID = "openid";
    public final static String WX_PARAM_HEAD_IMG_URL = "headimgurl";
    public final static String WX_PARAM_ERR_CODE = "errcode";
    public final static String WX_PARAM_TAGID_LIST = "tagid_list";
    public final static String WX_PARAM_SUBSCRIBE_TIME = "subscribe_time";

    /**
     * EEO controller
     */
    public final static String EEO_ADD_COURSE = "addCourse";
    public final static String EEO_EDIT_COURSE = "editCourse";
    public final static String EEO_DEL_COURSE = "delCourse";
    public final static String EEO_ADD_COURSE_CLASS_MULTIPLE = "addCourseClassMultiple";
    public final static String EEO_ADD_COURSE_CLASS = "addCourseClass";
    public final static String EEO_EDIT_COURSE_CLASS = "editCourseClass";
    public final static String EEO_DEL_COURSE_CLASS = "delCourseClass";
    public final static String EEO_REGISTER = "register";
    public final static String EEO_EDIT_USER_INFO = "editUserInfo";
    public final static String EEO_ADD_SCHOOL_STUDENT = "addSchoolStudent";
    public final static String EEO_ADD_COURSE_STUDENT_MULTIPLE = "addCourseStudentMultiple";
    public final static String EEO_DEL_COURSE_STUDENT_MULTIPLE = "delCourseStudentMultiple";
    public final static String EEO_ADD_CLASS_STUDENT_MULTIPLE = "addClassStudentMultiple";
    public final static String EEO_DEL_CLASS_STUDENT_MULTIPLE = "delClassStudentMultiple";
    public final static String EEO_ADD_TEACHER = "addTeacher";
    public final static String EEO_MODIFY_COURSE_TEACHER = "modifyCourseTeacher";
    public final static String EEO_GET_LOGIN_LINKED = "getLoginLinked";
    public final static String EEO_GET_FOLDER_LIST = "getFolderList";
    public final static String EEO_MODIFY_PASSWORD_BY_TELEPHONE = "modifyPasswordByTelephone";
    public final static String EEO_GET_WEB_CAST_URL = "getWebcastUrl";
    public final static String EEO_MODIFY_CLASS_SEAT_NUM = "modifyClassSeatNum";

    /**
     * dao param name
     */
    public final static String KEY_SID = "SID";
    public final static String KEY_SAFE_KEY = "safeKey";
    public final static String KEY_TIME_STAMP = "timeStamp";
    public final static String KEY_COURSE_INTRODUCE = "courseIntroduce";
    public final static String KEY_COURSE_NAME = "courseName";
    public final static String KEY_COURSE_STATUS = "courseStatus";
    public final static String KEY_PAGE = "page";
    public final static String KEY_PER_PAGE = "perpage";
    public final static String KEY_FOLDER_ID = "folderId";
    public final static String KEY_FILE_DATA = "Filedata";
    public final static String KEY_EXPIRY_TIME = "expiryTime";
    public final static String KEY_MASTER_ACCOUNT = "mainTeacherAccount";
    public final static String KEY_COURSE_ID = "courseId";
    public final static String KEY_BEGIN_TIME = "beginTime";
    public final static String KEY_CLASS_JSON = "classJson";
    public final static String KEY_END_TIME = "endTime";
    public final static String KEY_TEACHER_ACCOUNT = "teacherAccount";
    public final static String KEY_TEACHER_NAME = "teacherName";
    public final static String KEY_CLASS_ID = "classId";
    public final static String KEY_CLASS_NAME = "className";
    public final static String KEY_IDENTITY = "identity";
    public final static String KEY_TELEPHONE = "telephone";
    public final static String KEY_NICKNAME = "nickname";
    public final static String KEY_STUDENT_ACCOUNT = "studentAccount";
    public final static String KEY_STUDENT_NAME = "studentName";
    public final static String KEY_STUDENT_JSON = "studentJson";
    public final static String KEY_STUDENT_ARRAY = "studentArray";
    public final static String KEY_ACCOUNT = "account";
    public final static String KEY_USER_ACCOUNT = "userAccount";
    public final static String KEY_USER_NAME = "userName";
    public final static String KEY_NAME = "name";
    public final static String KEY_IS_REGISTER = "isRegister";
    public final static String KEY_NICK_NAME = "nickname";
    public final static String KEY_PASSWORD = "password";
    public final static String KEY_MD5PASS = "md5pass";
    public final static String KEY_OLD_MD5PASS = "oldMd5pass";
    public final static String KEY_STUDENT_ID = "studentId";
    public final static String KEY_TEACHER_EMAIL = "teacherEmail";
    public final static String KEY_ST_ID = "st_id";
    public final static String KEY_ID = "id";
    public final static String KEY_MARK_INFO = "markInfo";
    public final static String KEY_ANSWER_INFO_LIST = "answerInfoList";
    public final static String KEY_LIFE_TIME = "lifeTime";
    public final static String KEY_DATA = "data";
    public final static String KEY_ERROR_INFO = "error_info";
    public final static String KEY_ERRNO = "errno";
    public final static String KEY_ERROR = "error";
    public final static String KEY_REMARK = "remark";
    public final static String KEY_CLIENT_COURSE_ID = "client_course_id";
    public final static String KEY_CLIENT_CLASS_ID = "client_class_id";
    public final static String KEY_SCHOOL_ID = "schoolId";
    public final static String KEY_PRODUCT_NAME = "productName";
    public final static String KEY_AUTH_TICKET = "authTicket";
    public final static String KEY_RECORD = "record";
    public final static String KEY_LIVE = "live";
    public final static String KEY_REPLAY = "replay";
    public final static String KEY_SEAT_NUM = "seatNum";
    public final static String KEY_CODE = "code";
    public final static String KEY_CLASSROOM_TEST_RECORD = "classroomTestRecord";
    public final static String KEY_SUBJECT_ID = "subjectId";
    public final static String KEY_HOMEWORK_INDEX = "homeworkIndex";
    public final static String KEY_LESSON_ID = "lessonId";
    public final static String KEY_OUT_TRADE_NO = "outTradeNo";
    public final static String KEY_TOTAL = "total";
    public final static String KEY_INFO_LIST = "infoList";
    public final static String KEY_COUPON_STATUS = "couponStatus";
    public final static String KEY_QUERY_DATA = "queryData";

    /**
     * request param
     */
    public final static String PARAM_TARGET_URI = "target_uri";
    public final static String PARAM_KEY = "key";
    public final static String PARAM_COUPON_ID = "couponId";
    public final static String PARAM_DATA_STR = "dataStr";
    public final static String PARAM_PUBLIC_KEY = "publicKey";
    public final static String PARAM_CODE = "code";
    public final static String PARAM_FILE = "file";
    public final static String PARAM_FILES = "files";
    public final static String PARAM_FILE_TYPE = "fileType";
    public final static String PARAM_SESSION_ID = "sessionId";
    public final static String PARAM_SEAT_NUM = "seatNum";
    public final static String PARAM_OUT_TRADE_NO = "outTradeNo";
    public final static String PARAM_ID = "id";
    public final static String PARAM_SUBJECT_ID = "subjectId";
    public final static String PARAM_HOMEWORK_INDEX = "homeworkIndex";
    public final static String PARAM_EEO_CLASS_ID = "eeoClassId";
    public final static String PARAM_USER_ID = "userId";
    public final static String PARAM_USER_PWD = "userPwd";
    public final static String PARAM_USER_NAME = "userName";
    public final static String PARAM_USER_IP = "userIp";
    public final static String PARAM_COUPON_STATUS = "couponStatus";
    public final static String PARAM_COUPON_NAME = "couponName";
    public final static String PARAM_USER_ACCOUNT = "userAccount";
    public final static String PARAM_NICK_NAME = "nickName";
    public final static String PARAM_PRICE = "price";
    public final static String PARAM_URL = "url";
    public final static String PARAM_ORIGINAL_URL = "originalUrl";
    public final static String PARAM_COURSE_ID = "courseId";
    public final static String PARAM_COURSE_NAME = "courseName";
    public final static String PARAM_FILE_NAME = "fileName";
    public final static String PARAM_STATE = "state";
    public final static String PARAM_LESSON_ID = "lessonId";
    public final static String PARAM_LESSON_INDEX = "lessonIndex";
    public final static String PARAM_CLASS_ID = "classId";
    public final static String PARAM_CLASS_LEVEL = "classLevel";
    public final static String PARAM_CLASS_NAME = "className";
    public final static String PARAM_TYPE = "type";
    public final static String PARAM_STUDENT_ID = "studentId";
    public final static String PARAM_STUDENT_ACCOUNT = "studentAccount";
    public final static String PARAM_MASTER_ACCOUNT = "masterAccount";
    public final static String PARAM_TEACHER_ACCOUNT = "teacherAccount";
    public final static String PARAM_START_TIME = "startTime";
    public final static String PARAM_END_TIME = "endTime";
    public final static String PARAM_ORDER_ID = "orderId";
    public final static String PARAM_ADDRESS_ID = "addressId";
    public final static String PARAM_REMARK = "remark";
    public final static String PARAM_QUESTION_NUM = "questionNum";
    public final static String PARAM_ANSWER_DATA = "answerData";
    public final static String PARAM_TEST_NUM = "testNum";
    public final static String PARAM_QUESTION_SIZE = "questionSize";
    public final static String PARAM_SUBJECT_QUESTION_ID = "subjectQuestionId";
    public final static String PARAM_HOMEWORK_RECORD_ID = "homeworkRecordId";
    public final static String PARAM_PAGE_NUM = "pageNum";
    public final static String PARAM_PAGE_SIZE = "pageSize";
    public final static String PARAM_MARK_DATA_INFO = "markDataInfo";
    public final static String PARAM_PHONE_NUM = "phoneNum";
    public final static String PARAM_CUSTOMER_PHONE_NUM = "customerPhoneNum";
    public final static String PARAM_SALES_PHONE_NUM = "salesPhoneNum";
    public final static String PARAM_MEDIA_ID = "mediaId";
    public final static String PARAM_WX_FILE_TYPE = "wxFileType";
    public final static String PARAM_QUERY_DATA = "queryData";
    public final static String PARAM_PRODUCT_ID = "productId";
    public final static String PARAM_PRODUCT_NAME = "productName";
    public final static String PARAM_PRODUCT_STATUS = "productStatus";
    public final static String PARAM_PRODUCT_STAGE_ID = "stageId";
    public final static String PARAM_PRODUCT_CLASS_RULE = "classRule";
    public final static String PARAM_PRODUCT_ORDER_ADDRESS_ID = "addressId";
    public final static String PARAM_EEO_U_ID = "uId";

    public final static String STRING_COURSE_EXPERIENCE = "体验课";
    public final static String STRING_COURSE_SHORT_TERM = "短期课";
    public final static String STRING_COURSE_OPEN = "公开课";

    public final static String KEY_SYNC_RESULT = "sync";

    public final static String PARAM_REPORT = "report";
    public final static String PARAM_REPORT_CLASS_TEST_COUNT = "classTestCount";
    public final static String PARAM_REPORT_PER_RATE = "perRate";
    public final static String PARAM_REPORT_AVERAGE_RATE = "averageRate";
}

